/*
 * Copyright (C) 2012  E-dance Studio Harbin Institute of Technology 
 * Project:campusmobile
 * Author: 初楷博
 * Create Date: 2012-5-23上午09:26:52
 */
package hit.edance.campusmobile.chat.util;

/**   
 * 字符串处理工具<br/>
 * 
 * @Project campusmobile
 * @Package hit.edance.campusmobile.chat.util
 * @Class StringUtil
 * @Date 2012-5-23 上午09:26:52
 * @author 初楷博
 * @version 1.0
 * @since 1.0
 */
public class StringUtil {
	
	/**
	 * 截取指定分隔符前面的字符串
	 * 
	 * @param s 字符串
	 * @param separator 分隔符
	 * @return 分隔符前面的字符串
	 */
	public static String getLeftString(String s, String separator) {
		int index = s.indexOf(separator);
		return index > -1 ? s.substring(0, index) : s;
	}

}
